DeBabelizer 1.5.5

DeBabelizer Version 1.5.5 includes a few enhancements and additional functionality requested by users.

------------------------------------------------------------------
¥ Translator Changes

The following translators (Custom Code Modules) have been modified or added:

Abekas reader - this digital video format reader has been added.

Abekas writer  - "spotting" in some cases has been corrected.  Also, the image is no longer offset by 2 pixels to the right.

DPaint Anm reader - enhanced to read additional versions.

Apple ][ writer  - six times faster.

BMP reader - enhanced to read all versions of 24 bit BMP files.

LBM/IFF reader - enhanced to read Amiga HAM 8 and handle DOS odd-width PBM files. 

PICT reader - enhanced to handle PICTs which contain a combination of objects and pixmaps, and less than 256 colors.  Now reads PICT files which had non-PICT filetype, non-PICT resources in the resource fork, and the main PICT in the data fork. Now reads PICT files that contain pixmaps with different palettes. Now reads Now Scrapbook files.

QuickTime writer - enhanced to handle alpha channel.

Photoshop reader - enhanced to read all versions of grayscale Photoshop 2.0 images.

Raw Custom reader - can now read 24 and 32 bit images whose channels are stored non-interleaved by row and non-interleaved by image.  

------------------------------------------------------------------
¥ AppleScript

1.Run an AppleScript execution program, such as QuicKeys, Script Editor,  or DeBabelizer.

2.Give it a properly formatted AppleScript with DeBabelizer commands.

3.DeBabelizer will receive them and execute them.

¥ Executing AppleScripts
DeBabelizer can execute AppleScript scripts via the Scripts:Execute AppleScriptÉ function. 

1.Choose Scripts:Execute AppleScriptÉ 

2.An Open dialog appears. 

3.Select the AppleScript to be executed and click the Execute button. 

The AppleScript will be executed.

Note: Only files of type ÔTEXTÕ will be available in the dialog. 

Note: DeBabelizer will only execute text script files. It will not execute compiled AppleScript files (however, these can be executed from other programs, such as Script Editor).

¥ Exporting DeBabelizer Scripts as AppleScripts
DeBabelizer can export DeBabelizer scripts as AppleScript scripts (edittable text files) via the Scripts:Export AppleScript submenu. 

1.Select the DeBabelizer script to be exported from the Scripts:Export AppleScript submenu.

2. A Save dialog appears. 

3.Verify the file name and location and click the Save button. 

¥ AppleScript Export Options 
AppleScript Export Options may be set via the Misc:Preferences:AppleScript ExportÉ menu command.

Name of the target DeBabelizer to receive script
The first line of an AppleScript script indicates which program is the target of the subsequent commands. This option allows you to set this to either the name of the copy of DeBabelizer running at the time, or to a name which can be typed in.

Append command "Display Picture"
When a function is executed via AppleScript, usually the image is not updated afterwards. This is to allow for a series of operations to be executed without the time delay associated with updating the display. If the display is not updated after the last function, and the display window is selected, often the image will appear garbled. It is not. It simply needs to be updated. Flipping the image twice is one way to do this. However, the best way is to append the function Display Picture to the end of the AppleScript which is exported. 

Check the Append Display Picture checkbox to append this function to the end of an AppleScript.

Styles popup menu
When a DeBabelizer function requiring a dialog box is converted to an AppleScript, there are several parameters which must be formatted after the function name. The Style popup menu allows a choice of either placing one parameter per line (easier to read, but takes more space), or of packing them all on one line (more compact, but hard to read). 

Filename popup menu
When the Save dialog appears for the Export AppleScript function, it displays a default filename. This popup menu allows the choice of either the last name typed in, or the DeBabelizer script name.

Note:  For a more complete description of the AppleScript parameters displayed for the functions, contact Equilibrium Technical Support.

------------------------------------------------------------------
¥ Image Info Window

The Image Info Window now displays a multiple cell file's cell number on a separate line below the file name.  

¥ Plug-ins

DeBabelizer 1.5.5 can use Adobe Photoshop 2.0 Acquire, Filter, and Export plug-ins. Use of Photoshop 2.5 plug-ins is not recommended.  Many of them require the internal mechanisms of Photoshop.

¥ Selection Marquee Settings

By double clicking the Selection Marquee Tool in the Image Info Window,  selection coordinates may be set in pixels.  This function may be set within a script by selecting Set Selection Marquee from the Script Extra Functions popup menu in the Edit Script Dialog.  

Double click the Selection Marquee Tool (or  choose Set Selection Marquee from the Script Extra Functions popup menu, and click it).

The selection values will be set to the values set last time with the Selection Marquee Dialog (these may be different from the current pictureÕs selection). 

The following buttons alter the proposed selection marquee values:

Select All sets selection coordinates  to the entire picture.

Current sets selection coordinates to the imageÕs current selection.

Top row sets selection coordinates to just the top row of the imageÕs current selection.

Left column sets selection coordinates to just the left column of the imageÕs current selection.

Stashed sets selection coordinates to the currently stashed selection marquee.

Clear clears the selection coordinates to nothing.

Revert sets the selection coordinates back to what they were on entry to the Selection Marquee Dialog.

Stash Selection Marquee stashes the currently displayed selection marquee values into the Òstashed marqueeÓ.  This is used mainly to prepare for a Batch which runs a script which moves the selection box. It performs exactly the same function as the popup menu item Stash Selection Marquee in the Edit Script Dialog.

Warning:   If there already is a selection floating over the image when this function is executed, this will delete it and create a new selection marquee. 

 
¥ Edit: Selection Transparency: Background Color

All the pixels in the current selection except the Background Color pixels will write over the pixels in the current image.  The Background Color is defined in the Palette:Options:Dithering & Background Color dialog.

¥ Palette: Options: Color Reduction & Remapping...

For advanced users.

Hold down the Option key while choosing the Palette: Options: Color Reduction & Remapping... command. and new options appear.

Bits Per Gun popup menu
WARNING: use settings less than 8 bits only if absolutely necessary because any settings less than 8 will result in a degraded palette.
Most display devices can display 8 bits (256 levels) for each color gun (red, green, and blue), giving a total of 17 million possible colors. Some specialized display devices are limited to a lesser number of levels. 

Example: Some video game hardware can display only 4 bits (16 levels) for each color gun, giving a total of 4096 possible colors.

When reducing colors for such a limited device, set the Bits Per Gun popup menu to the appropriate number of levels supported by the destination display device. 

When DeBabelizer reduces colors (such as via the Change Pixel Depth submenu, or from the Reduce Colors... command) it will consider this setting and will produce an appropriate palette in which each gun uses only the specified number of levels.

Example:  If the setting is for 3 bits per gun, then the resulting palette will contain red, green, and blue values from 0 through 7, expanded to 0 through 255 as follows: 0->0, 1->34, 2->73, 3->109, 4->146, 5->182, 6->219, 7->255.

Color Selection Bias popup menu
Select the desired color selection bias method.

RGB Dimensions + RGB Asymmetry + Population
Recommended for best overall results.

RGB Dimensions + Population

RGB Volume * Population

RGB Volume
Method used by DeBabelizer Version 1.4

Population

About Color Selection Bias
When the RGB colorspace is being subdivided into the requested number of colors, it is subdivided into smaller and smaller boxes of colors. The color selection bias determines which box is selected next to be sliced into two boxes. The boxÕs properties are:

Population 
The number of pixels in the box.

RGB Dimensions
The sum of the R, G, and B dimensions of the box.

RGB Volume
The product of the R, G, and B dimensions of the box.

RGB Asymmetry
How far off the box is from being a cube, which is the most desirable box shape for accurate color choice.


Simulating DeBabelizer Version 1.4 color reduction method
It is not possible to duplicate version 1.4Õs method exactly because of an internal unmodifiable change to the program.

For similar results, set

Color Selection Bias popup menu to RGB Volume

Reduction Threshold to 0

RGB Polling maximum to 512.


¥ Palette:B & W/Grayscale:256 Grays From 16 Bits Gray

For advanced users.

This function will convert a 16 bit grayscale image to an 8 bit grayscale image. 

Choose this function and it first scans the image to determine the range of grayscale values, then on the second pass it scales all values between the maximum and minimum values down to fit in the range 0 to 255. 

Most 15 or 16 bit images are color images which contain 5 bits for the red, green, and blue guns.  However, in some special cases, these 16 bits actually represent a single grayscale value. Since DeBabelizer cannot display or filter or save a 16 bit grayscale image, this function is useful in converting it to a displayable, filterable, and savable 8 bit grayscale image. These 16 bit grayscale images often originate from the Raw Custom reader.

¥ Palette: Super Palette

The polling capacity of a Super Palette has been increased from 65,000 pixels/color to over 4 billion, thus allowing a Super Palette to be created from many thousands of images.

The following functions enable a Super Palette to be built over a period of time. For example, all images that need to be factored into a Super Palette cannot be loaded in one session due to disk space limitations, 

Load Poll
Loads a Super Palette Poll file, replacing the current palette voting with that from the file.

Load Poll & Merge
Loads a Super Palette Poll file, adding its contents to the current palette voting.

Save Poll
Saves the current palette voting into a file which may be loaded later using the Load Poll or Load Poll & Merge commands.

¥ Misc:Scripts-Palettes-Etc.

Export...
The Export menu command is inactive (grayed out) if there is nothing to be exported.

The number of Scripts, Palettes, Batches or Catalog Styles that can be exported is displayed to the left of each item's checkbox.


Delete All
Choose this command to delete all Scripts, Palettes, Batches, and Catalog Styles.


¥ Script:Extra Functions popup menu

Copy From Image To Selection
This function copies the area under the current Selection Marquee into the selection (as opposed to an empty selection marquee).  It does not clear the area copied from the image. This is identical to manually dragging the selection while holding down the Option key.

Copy+Clear From Image To Selection
This function copies the area under the current Selection Marquee into the selection (as opposed to an empty selection marquee).  It clears the area copied from the image after the copy. This is identical to manually dragging the selection.

---------------------------------------------------------------
¥ Palette:Set Palette & Remap Pixels...:Windows Default 256 Palette

A Default Windows 256 Palette is now included in the Palettes Submenu.  It is included for convenience.  The following was written by the palette's creator, Tom McFarland, and is excerpted from the magazine Morph's Outpost on the Digital Frontier.  We've included it to give you some background on this palette.
  
Bitmapped Images and Diverse Palettes
by Thomas McFarland
Copyright 1993, by Morph's Outpost on the Digital Frontier & Tom McFarland. Reprinted by permission.

As multimedia development continues to grow, nearly every title includes photographic images to enrich the presentation.  But, the standard VGA adapter falls short of displaying everything the human eye can see.  It is limited in both the number of pixels and colors it can show.  VGA images require a 16- or 256-color palette to manage color capabilities.  For example, the original VGA adapter displayed 320 by 200 pixels with 256 colors available for each pixel.  The list of available colors is called the hardware palette, and each point has an index or palette number.  Modern SVGA displays show more pixels on screen, but still use a 256-color palette register.  

Building and Storing Images
Video digitizers and scanners generate bitmapped or pixel- based images, and the most accurate way to represent the image is to store three bytes of data for each pixel describing its red, green, and blue color components.  But this file would be huge, and could not be directly displayed on ordinary VGA adapters, so the file must first be condensed into a paletted image. If the image contains fewer colors than the chosen palette size, the conversion is easy: create a palette table entry for each unique color and substitute the palette index number point by point.  When the new paletted image is stored in a file, the whole palette table is stored along with the pixel data.  When the image is redisplayed on the VGA adapter, the pixel data is loaded into a frame buffer to hold the image, and the VGA color registers are set to match the imageÕs palette table. But if the image contains more colors than will fit into a palette, which is normal, the task is much harder.  

This reduction in colors is typically done by choosing the most frequently used colors from the image and assigning them to the palette until there is no more palette space. To create the new paletted file, each point is given an index that best matches its original color. Some pixels will have a perfect match in the palette, but pixels without an exact color match can be rounded off to their nearest palette color (with surprisingly good results).  

Additionally, some image utilities provide ÔditheringÕ features which further disguise the shortage of colors by clustering pixels to create new color blends.

Some Problems  
This paletting method works very well, but there can be problems depending on how you use the images.  A crucial limitation is that the VGA adapter can display no more than 256 colors at one time.  This is not so obvious when paletted images are loaded one after 
another.  As a new image is loaded, there may be a brief moment when the pixels from one image are being displayed using the wrong palette from the previous image, but if both images are shown full screen, the problem will correct itself quickly. However, if you mix paletted images on screen at the same time this limitation will surface right away.  For example, Image A is displayed full screen and contains a palette with all blue and gray tones.  Then a smaller Image B with lots of red and yellow is pasted on top of the first. When the second image loads, its palette table takes  charge, and the visible portions of the first image take on bizarre colors and things look very bad.  The larger the color differences in the two palettes, the worse things will look. If you are doing multimedia or desktop presentations with multiple images, the results can be disastrous. 

Inside Windows Palettes
A major benefit of Microsoft Windows is that it insulates the applications from the graphics hardware so that multiple programs can run at the same time and share the screen.  Therefore, Windows programs should almost never take direct control of the display adapter, but instead use the graphics services provided by Windows routines.  Windows applications request graphics output as though they were running on a kind of virtual workstation and it is up to Windows and special device drivers to sort all that out for your particular hardware.  This isnÕt easy, but it means that one program can operate successfully on a wide variety of hardware configurations and co-exist with other software. But color presents a very special problem.  Under Windows, VGA and SVGA displays range in capability from 16 to 16 million colors.  How can a program sort out which colors are available and correctly display a bit-mapped image?  The answer is that Windows tracks up to 16 million colors using 24-bit notation and uses multiple palettes to keep the applicationsÕ color needs isolated from the hardware settings.  Programs are free to operate in a ideal graphics world with millions of colors and thousands of pixels, while Windows takes care of translating their requests into the limitations of the real world. When Windows is first installed, the color and resolution settings for your video hardware are determined.  At the lowest resolution of 640 by 480 pixels, standard VGA adapters can display 16 colors, SVGA adapters usually allow 256 colors, and some newer adapters offer 16 million colors.  Windows knows these settings and directly manages the display adapter hardware through a system default palette.  Meanwhile, applications create and use their own logical palettes in memory as they need them.  Millions of unique colors are possible by using a number from 0-255 for each of the color primariesÑ red, green, and blue.   A program can use a palette to manage its color data, but when that program wants to set a pixel to a certain shade of color, it asks Windows to do it.  If possible, Windows will assign a color in the system palette to that shade, but if it cannot, it will use the closest available color.  As a result, Windows does a fair job of dithering and displaying images with thousands of colors even on a 16-color screen.  When several programs are on-screen at the same time, the window on top gets the first pick of the available system colors.  Sometimes this causes the windows underneath to look less than perfect! 
 
The colors chosen for the system palette are very important.  In 16-color mode, all 16 colors are fixed and match the default VGA adapter colors.  In 24-bit mode (16 million colors), Windows can give the applications just about any color they want.  But in 256-color mode,  Windows reserves 20 colors for menus, buttons, and desktop fixtures and adjusts the other 236 colors as needed by applications.   The 256-color display mode is the most likely candidate for a universal palette, and it is a very popular choice for multimedia presentations. 

The Universal Windows 256-color Palette. After working out a 256-color DOS palette, I decided to adapt it to Windows.  I looked closely at the 20 static colors that Windows reserves in every system palette and decided to combine them with my DOS palette.  I altered the first 16 EGA colors in the DOS palette to exactly match 16 of the reserved Windows colors and I used four less important shades of blue to create the remaining reserved colors.   Finally I shifted things around so that the 20 reserved colors appear in the correct places in the palette (the first 10 and last 10 positions).  The Universal Windows 256-color Palette is shown on this page. In practice, this palette works just as well as the DOS version.  Multiple images no longer clash and there is no visible redraw when a new image is put up on screen.  Since Windows does not have to recompute new palette mapping for everybody, the redisplay process is much faster.  On slow machines, this remap and redraw process can easily take a second or two for each image and it is rather ugly.  By using the same palette throughout the presentation, images display quicker and cleaner.  

Building A Great Windows Image
Here are some tips for your 256-color images in Windows.  
1) Start with the best image you can get.  If you are scanning or digitizing, choose 24-bit color.  Adjust cropping, contrast, brightness, and color balance now.
2) Use a specialized image utility to create the 256-color file from the same palette.  Remember to set dithering on.  
3) Experiment with your setup to fine tune the image.  Try the default Windows palette or build your own palette to better fit your presentation, just remember the first 10 and last 10 indexes belong to Windows. 

